package Queue;

/**
 * Created by sunwei on 2017/10/10
 * Time:10:58
 */
public class LinkQueue {
    private FirstLastLink firstLastLink;//实例化FirstLastLink对象

    /*
    构造函数
     */
    public LinkQueue() {
        firstLastLink = new FirstLastLink();
    }

    /*
    判断队列是否是空
     */
    public boolean isEmpty(){
        return firstLastLink.isEmpty();
    }

    /*
    向队列插入元素
     */
    public void insert(double j){
        firstLastLink.insertLast(j);
    }

    /*
    移除队列里面的元素
     */
    public double remove(){
        return firstLastLink.deleteLink();
    }

    /*
    遍历显示队列
     */
    public void displayQueue(){
        System.out.print("Queue(front-->rear):");
        firstLastLink.displayList();
    }
}
